package com.walker.web.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @Description:
 * @ProjectName: walker-step
 * @Package: com.walker.web.config
 * @ClassName: Person
 * @Author: yangyl
 * @CreateDate: 2020/8/5 22:31
 */
@Component
@PropertySource(value = {"classpath:person.properties"},encoding = "UTF-8")
public class Person {

    @Value("${person.username}")
    private String username;
    @Value("${person.age}")
    private Integer age;
    @Value("${person.birthDate}")
    private Date birthDate;

    private List<String> hobby;
    private Map<String,Object> others;

    private List<Map<String,Object>> workContents;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Date getBirthDate() {
        return birthDate;
    }

    public void setBirthDate(Date birthDate) {
        this.birthDate = birthDate;
    }

    public List<String> getHobby() {
        return hobby;
    }

    public void setHobby(List<String> hobby) {
        this.hobby = hobby;
    }

    public Map<String, Object> getOthers() {
        return others;
    }

    public void setOthers(Map<String, Object> others) {
        this.others = others;
    }

    public List<Map<String, Object>> getWorkContents() {
        return workContents;
    }

    public void setWorkContents(List<Map<String, Object>> workContents) {
        this.workContents = workContents;
    }

    @Override
    public String toString() {
        return "Person{" +
                "username='" + username + '\'' +
                ", age=" + age +
                ", birthDate=" + birthDate +
                ", hobby=" + hobby +
                ", others=" + others +
                ", workContents=" + workContents +
                '}';
    }
}
